import {
    http3,
    http4
} from "@/service/axios";

// 场库信息列表
export function getParkingList(data) {
    return http4.post({
        url: "/cpark/list/page",
        data,
    });
}

// 场库状态编辑
export function getEnabledAPi({
    id,
    enabled
}) {
    return http4.put({
        url: `/cpark/edit/${id}/${enabled}`
    })
}

// 物业公司下拉列表
export function getCparkCom() {
    return http4.get({
        url: `/cpark/com/kvs`
    })
}

// 上传图片
export function getUpload(data) {
    return http3.post({
        url: "/file/upload",
        data,
    });
}

// 新增场库
export function getAddCpark(data) {
    return http4.post({
        url: '/cpark/add',
        data
    })
}

// 场库详情
export function getCparkForm(id) {
    return http4.get({
        url: `/cpark/form/${id}`
    })
}

// 编辑车场
export function getEditCpark({
    id,
    data
}) {
    return http4.put({
        url: `/cpark/edit/${id}`,
        data
    })
}

// 编辑车场权限
export function getEditCparkPerm({
    id,
    data
}) {
    return http4.put({
        url: `/cpark/perm/edit/${id}`,
        data
    })
}

// 获取车场设备（树形）列表
export function getDeviceTree(id) {
    return http4.get({
        url: `/cpark/facility/tree/${id}`
    })
}

// 新增岗亭
export function getEntryAdd(data) {
    return http4.post({
        url: '/cpark/entry/add',
        data
    })
}

// 编辑岗亭
export function getEntryEdit({id,data}) {
    return http4.post({
        url: `/cpark/entry/edit/${id}`,
        data
    })
}

// 新增通道
export function getPassAdd(data) {
    return http4.post({
        url: '/cpark/pass/add',
        data
    })
}

// 编辑通道
export function getPassEdit({id,data}) {
    return http4.post({
        url: `/cpark/pass/edit/${id}`,
        data
    })
}

export function getEnabledAPi2({
    id,
    status,
    type
}) {
    return http4.put({
        url: `/cpark/facility/${status}/${type}/${id}`
    })
}